<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/common/scripts.jsp"%>
<script type="text/javascript">
$(function(){
    $("#queryBtn").click(function(){
        $("#theForm").submit();
    });
});
</script>
</head>
<body>
    <div class="pageOuter">

        <div class="contentOuter">
            <!--search-->
            <div class="searchContainer">

                <form:form action="query" name="theForm" id="theForm" method="post" commandName="query">
                    <table class="queryForm" style="width: auto;">
                        <tr>
                            <td><fmt:message key='bo.AppItem.appName'/></td>
                            <td><form:input path="appName" size="15" cssStyle="width:100%;" /></td>
                            <td><fmt:message key='bo.AppItem.owner'/></td>
                            <td><form:input path="owner" size="15" cssStyle="width:100%;" /></td>
                            
                            <td><fmt:message key='bo.AppItem.appSource'/></td>
                            <td><form:select path="sourceId">
                              <form:option label="" value=""/>
                              <form:options items="${sourceList }" itemLabel="dictionaryName" itemValue="id" />
                            </form:select></td>
                            <td><fmt:message key='bo.AppItem.appCategory'/></td>
                            <td><form:select path="categoryId">
                              <form:option label="" value=""/>
                              <form:options items="${categoryList }" itemLabel="dictionaryName" itemValue="id" />
                            </form:select></td>                                                                                                           
                            <td><a href="javascript:void(0)" id="queryBtn" class="css_btn"><img class="button search" src="<c:url value='/images/icon_transparent.png'/>" />
                            <fmt:message key='button.query' /></a></td>
                        </tr>
                    </table>
                </form:form>
            </div>
            <div class="pageTitle">
                <fmt:message key='menu.manage.app' />
            </div>
            <div class="buttonBox_R">
            	<a href="<c:url value='add'/>" class="css_btn" style="float: right;"><img class="button add" src="<c:url value='/images/icon_transparent.png'/>" /> <fmt:message key='button.add' /></a>
            </div>
    
            <c:if test='${appItemList != null}'>
                <display:table name='appItemList' id='appItem' class='grid_list' requestURI='query'>
                    <display:column titleKey='bo.AppItem.appName' style="width:15%" sortable='true' sortProperty='appName'>
                        <a href="<c:url value='edit?id=${appItem.id}'/>"><c:out value='${appItem.appName}' /></a>
                    </display:column>
    
                    <display:column titleKey='bo.AppItem.owner' style="width:15%" sortable='true' sortProperty='owner'>
                        <c:out value='${appItem.owner}' />
                    </display:column>
    
                    <display:column titleKey='bo.AppItem.appSource' style="width:10%" sortable='true' sortProperty='appSource.dictionaryName'>
                        <c:out value='${appItem.appSource.dictionaryName}' />
                    </display:column>
    
                    <display:column titleKey='bo.AppItem.appCategory' style="width:10%" sortable='true' sortProperty='appCategory.dictionaryName'>
                        <c:out value='${appItem.appCategory.dictionaryName}' />
                    </display:column>  
                    
                    <display:column titleKey='bo.AppItem.appIntro' style="width:45%" sortable='true' sortProperty='appIntro'>
                        <c:out value='${appItem.appIntro}' />
                    </display:column>  
                                          
                    <display:column class="textAlignCenter" style="width:10%" titleKey='bo.AppItem.enable'  sortable='true' sortProperty='enable'>
                        <c:if test='${appItem.enable}'>
                            <fmt:message key='bo.AppItem.enable.true'/>
                        </c:if>
                        <c:if test='${!appItem.enable}'>
                            <fmt:message key='bo.AppItem.enable.false'/>
                        </c:if>
                    </display:column>
                    <%@include file="/common/displaytag.jsp"%>
                </display:table>
            </c:if>
        </div>
    </div>
</body>
</html>
